﻿using System;
namespace Dong.Model
{
    /// <summary>
    /// OutboundRecord:实体类，OutboundRecord类是对数据库中OutboundRecord表的映射。
    /// </summary>
    [Serializable]
    public partial class OutboundRecord
    {
        public OutboundRecord()
        { }
        #region Model
        // 字段一般私有
        private int _outboundid;
        private int _storeareaid;
        private int _productid;
        private int _amount;
        private DateTime _outboundtime;
        private string _remark;
        private int _status = 0;
        private int _createuserid;
        private DateTime _createtime = DateTime.Now;
        private int? _lastupdateuserid;  // int?===Nullable<int>
        private DateTime? _lastupdatetime;

        // 属性一般建议对外公开
        /// <summary>
        /// 出库记录Id
        /// </summary>
        public int OutboundId
        {
            // 设置值
            set {
                // 做一些校验操作
                if (value <= 0) { 
                    throw new Exception("值不能为负数！"); 
                }
                _outboundid = value;
            }
            // 获取值
            get {
                // 做一些格式化的操作。
                return _outboundid;
            }
        }
        /// <summary>
        /// 仓库区域Id
        /// </summary>
        public int StoreAreaId
        {
            set { _storeareaid = value; }
            get { return _storeareaid; }
        }
        /// <summary>
        /// 产品Id
        /// </summary>
        public int ProductId
        {
            set { _productid = value; }
            get { return _productid; }
        }
        /// <summary>
        /// 数量
        /// </summary>
        public int Amount
        {
            set { _amount = value; }
            get { return _amount; }
        }
        /// <summary>
        /// 出库时间
        /// </summary>
        public DateTime OutboundTime
        {
            set { _outboundtime = value; }
            get { return _outboundtime; }
        }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            set { _remark = value; }
            get { return _remark; }
        }
        /// <summary>
        /// 状态（0正常，1禁用）
        /// </summary>
        public int Status
        {
            set { _status = value; }
            get { return _status; }
        }
        /// <summary>
        /// 创建者Id
        /// </summary>
        public int CreateUserId
        {
            set { _createuserid = value; }
            get { return _createuserid; }
        }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime
        {
            set { _createtime = value; }
            get { return _createtime; }
        }
        /// <summary>
        /// 最后一次修改者Id
        /// </summary>
        public int? LastUpdateUserId
        {
            set { _lastupdateuserid = value; }
            get { return _lastupdateuserid; }
        }
        /// <summary>
        /// 最后一次修改时间
        /// </summary>
        public DateTime? LastUpdateTime
        {
            set { _lastupdatetime = value; }
            get { return _lastupdatetime; }
        }

        // 自动属性，不需要私有字段
        public int MyProperty { get; set; }
        #endregion Model

    }
}

